﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace TankWin.Classes
{
    class ObjTankAttacker:ObjTank
    {
        int _countFire = 0;//diem so lan di chuyen de ban
        public static int _Max_count = 10;
        /*Lop nay thua ke tu lop ObjTank
         * trong lop nay ta khong thay doi gi nhieu
         * O ham nay thi ObjTank cung chay toi gap vat can thif khong lam gi
         * Con voi ObjTankAttacker thi se thuc hien tu dong chuyen huong*/
        public ObjTankAttacker(Point _position, EStatusDirect _direct, int _c)
            : base(_position, _direct, _c)
        {

        }
        /*overridelai ham moveFoward()
         * trong do ta se xet ban do voi bien mang ObjMap._map
         * va tu dong chuyen huong khi gap vat can
         */
        public override void MoveFoward()
        {
            _countFire++;
            if (_countFire >= _Max_count)
            {
                Fire();
                _countFire = 0;
            }
            base.MoveFoward();
        }
    }
}
